Avoid possible live-lock in vcpu_migrate
authorJuergen Gross <juergen.gross@ts.fujitsu.com>
Mon, 28 Feb 2011 15:09:33 +0000 (15:09 +0000)
committerJuergen Gross <juergen.gross@ts.fujitsu.com>
Mon, 28 Feb 2011 15:09:33 +0000 (15:09 +0000)
commit2e13a886e5a82621bd916479ed192ed59eb05e72
treea34fc79adf929b9787275197ea1a0a861a056189
parent80ce9f75e5223dbfc95fcddb7139fc474043ca8e
Avoid possible live-lock in vcpu_migrate

If vcpu_migrate is called for two vcpus active on different cpus
resulting in swapping the cpus, a live-lock could occur as both
instances try to take the scheduling lock of the physical cpus in
opposite order.

To avoid this problem the locks are always taken in the same order
(sorted by the address of the lock).

Signed-off-by: Jueregn Gross <juergen.gross@ts.fujitsu.com>
xen/common/schedule.c